<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%>
<%@ page import="performReservation.SMMDBBean"%>
<%@ page import="java.sql.*"%>
<%!
	Cookie cookies[] = null;
	String email = null;


%>
<jsp:useBean id="cus" scope="page" class="performReservation.Customer"/>

<%
	cookies = request.getCookies();
	if(cookies == null){
		%>
		<jsp:forward page="login.jsp"/>
		<%
	}else{
		for(int i =0;i<cookies.length;i++)
		{
			if(cookies[i].getName().equals("email")){
				email = cookies[i].getValue();
			}
		}
		cus.setEmail(email);
		SMMDBBean mProcess = SMMDBBean.getInstance();
		cus = mProcess.getCustomer(cus);
		if(cus==null){
			%>
			<jsp:forward page="login.jsp"/>
			<%
		}else {
			
			%>
			<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
			<html>
			<head>
			<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
			<title>Your registered information!</title>
			</head>
			<body>
				<center>Your information</center>
				<form method="post" action="myInfoPro.jsp"/>
					<table width="300" border="1" cellspacing="0" cellpadding="0" bgcolor="white" align="center">
						<tr>
							<td  width="120" bgcolor="white" align="center" >Name</td>
							<td  width="200">
							<input type="text" size="15" maxlength="20" name="name" value="<%=cus.getName() %>"></td>
						</tr>
						<tr>
							<td  width="120" bgcolor="white" align="center" >Nickname</td>
							<td  width="200">
							<input type="text" size="15" maxlength="20" name="nick" value="<%=cus.getNickname() %>"></td>
						</tr>
						<tr>
							<td  width="120" bgcolor="white" align="center" >Email</td>
							<td  width="200">
							<input type="text" size="25" maxlength="30" name="email" value="<%=email %>" readonly></td>
						</tr>
						<tr>
							<td  width="120" bgcolor="white" align="center" >Address</td>
							<td  width="200">
							<input type="text" size="50" maxlength="90" name="address" value="<%=cus.getAddress() %>"></td>
						</tr>
						<tr>
							<td  width="120" bgcolor="white" align="center" >Password</td>
							<td  width="200">
							<input type="password" size="27" maxlength="30" name="password"></td>
						</tr>
						<tr>
							<td  width="120" bgcolor="white" align="center" >Confirm Password</td>
							<td  width="200">
							<input type="password" size="27" maxlength="30" name="cpassword"></td>
						</tr>
					</table>
					<table width="300" border="1" cellspacing="0" cellpadding="0" bgcolor="white" align="center">
						<tr>
							<td width="300" align="center">
							<input type="submit" value="Submit"> <input type="reset" value="Cancle">
							</td>
					</table>
				</form>
			</body>
			</html>
			
			<%
		}
	}
%>


